package com.blb.community_admin.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.community_admin.entity.SysMenu;
import com.blb.community_admin.entity.vo.MenuVO;
import com.blb.community_admin.mapper.SysMenuMapper;
import com.blb.community_admin.service.ISysMenuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {

    @Resource
    private SysMenuMapper sysMenuMapper;

    @Override
    public List<MenuVO> getMenuPage(String username) {
        List<MenuVO> menus = sysMenuMapper.selectMenus(username);
        return menus;
    }

    @Override
    public List<MenuVO> getAllMenu() {
        return sysMenuMapper.selectAllMenus();
    }

    @Override
    public List<MenuVO> getMenuByName(String menuName, String status) {
        return sysMenuMapper.selectMenuByName(menuName,status);
    }
}
